<template>
  <div class="detail-bottom-bar">
    <div class="no-clor">
      <div>
        <div class="icon alien"/>
        <span>客服</span>
      </div>
      <div>
        <div class="icon shop"/>
        <span>店铺</span>
      </div>
      <div>
        <div class="icon"/>
        <span>收藏</span>
      </div>
    </div>
    <div class="color">
      <div class="cart"><span @click="addToCart">加入购物车</span></div>
      <div class="buy"><span @click="buy">购买</span></div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailBottomBar",
    methods:{
      addToCart(){
        this.$emit('addToCart')
        this.$toast({message:'加入购物车成功',duration:2000})
      },
      buy(){
        this.$toast({message:'不卖(＾Ｕ＾)ノ~ＹＯ',duration:2000})
      }
    }
  }
</script>

<style scoped>
  .cart{
    width: 50%;
    display: flex;
    justify-content: center;
    background-color: #ffe817;
  }
  .cart span{
    align-self: center;
  }
  .buy{
    width: 50%;
    display: flex;
    justify-content: center;
    background-color: #f69;
    color: #fff;
  }
  .buy span{
    align-self: center;
  }
  .color{
    display: flex;
    width: 50%;
    font-size: 15px;
  }
  .icon{
    width: 22px;
    height: 22px;
    background-image: url("~assets/img/detail/detail_bottom.png");
    background-size: 100%;
    margin-bottom: 6px;
    margin-left: 3px;
  }
  .alien{
    background-position:0 -54px;
  }
  .shop{
    background-position:0 -98px;
  }
  .detail-bottom-bar{
    display: flex;
    z-index: 10;
    height: 58px;
    position: fixed;
    background-color: #fff;
    width: 100%;
    bottom: 0;
  }
  .no-clor{
    font-size: 14px;
    width: 50%;
    display: flex;
    justify-content: space-around;
    padding-top: 13px;
  }
</style>